<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>报价</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/build/css/doc.css" media="all">
</head>
<body>
<div class="layui-form-item">
    <label class="layui-form-label">更新</label>
    <div class="layui-input-block site-block">
        <form class="layui-form" action="/product/update" method="post">
            <input type="hidden" value="${product.productNO}" name="productNO"/>
            <div class="layui-form-item">
                <label class="layui-form-label">产品名称</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.productName}" name="productName" required
                           lay-verify="required" placeholder="请输入产品名称" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">产品类型</label>
                <div class="layui-input-block">
                    <select name="producttypeNO" lay-verify="" lay-search>
                        <c:forEach items="${productTypes}" var="type">
                            <option value="${type.producttypeNO}"
                                <c:if test="${product.producttypeNO==type.producttypeNO}">selected</c:if>>
                                    ${type.producttypeName}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">产品产地</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.producingArea}" name="producingArea" required  lay-verify="required"
                           placeholder="请输入产品产地" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">产品所有者</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.productOwner}" name="productOwner" required  lay-verify="required"
                           placeholder="请输入产品所有者" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">数量</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.quantity}" name="quantity" required  lay-verify="required"
                           placeholder="请输入数量" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">单位</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.unit}" name="unit" required  lay-verify="required"
                           placeholder="请输入单位" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">价格</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.price}" name="price" required  lay-verify="required"
                           placeholder="请输入价格" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">其他信息</label>
                <div class="layui-input-block">
                    <input type="text" value="${product.otherInfo}" name="otherInfo" required  lay-verify="required" placeholder="其他信息" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="/plugins/layui/layui.js"></script>
<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            // layer.msg(JSON.stringify(data.field));
            console.log(data);
            return true;

        });
    });
</script>
</body>
</html>